package com.zbkj.service.util;


import org.apache.commons.collections4.CollectionUtils;

import java.util.List;

public class ListUtils {
    public static String getListStr(List<String> list) {
        StringBuilder stringBuilder = null;
        if (CollectionUtils.isEmpty(list)) {
            return null;
        }
        for (String s : list) {
            if (stringBuilder == null) {
                stringBuilder = new StringBuilder();
            } else {
                stringBuilder.append(",");
            }
            stringBuilder.append(s);
        }
        if (stringBuilder != null) {
            return stringBuilder.toString();
        } else {
            return null;
        }
    }
}
